package com.boomsecret.limiter;


import com.google.common.util.concurrent.RateLimiter;

/**
 * @author wangjinliang on 2019/2/14.
 */
public class RateLimiterDemo {

    public static void main(String[] args) throws Exception {
        RateLimiter rateLimiter = RateLimiter.create(1);

        while (true) {
            double acquire = rateLimiter.acquire();
            System.out.println(System.currentTimeMillis() + "  " + acquire);
        }
    }
}
